<?php
if(!isset($_SESSION))
    session_start();
?>
<?php
if(isset($_SESSION['uname']))
    $uname = $_SESSION['uname'];
else
    header("Location: http://192.168.1.205:8888/homepage.php");  
?>
<html>
<head>
<title>用户界面(qiao.com)</title>
</head>
<body>
<?php
require_once '20161010_1.php';
echo "<br>";
$masage = $_POST['other'];
$top = $_POST['title'];
if ($masage != NULL){
$sq = "INSERT INTO topicinfo(topic_title,topic_pasage,topic_man,birth_date) VALUES ('$top','$masage','$uname',NOW())";
mysqli_query($conn,$sq);}
$sql="SELECT * FROM topicinfo";
if ($result=mysqli_query($conn,$sql))
{
	// 一条条获取
	while ($row=mysqli_fetch_row($result))
	{
          echo "<a href='http://192.168.1.205:8888/answer.php?name=$row[1]'>$row[1] </a>";
	  echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;by$row[3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;于$row[4]";
		echo "<br>";
	}
	
	// 释放结果集合
	mysqli_free_result($result);
}
mysqli_close($conn);
?>
<form name="input" action="userpage.php" method="post">
帖子名: <input type="text" name="title"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;内容:<textarea rows="10" cols="30px" name="other"></textarea>
<input type="submit" value="发帖">
<script>
function jump1(){
window.location.href="http://192.168.1.205:8888/login.php";
}
</script>
<input type="button" value="注销" onclick=javascrtpt:jump1()>
</form>
</body>
</html>